<template>
  <div class="page">
    <van-nav-bar
      title="欢迎使用实训云 - 教师端"
    />
    <van-grid :column-num="2" square>
      <van-grid-item icon="passed" text="登录" to="/login" />
      <van-grid-item icon="location-o" text="班级管理" to="/class/index" />
      <van-grid-item icon="friends-o" text="学生管理" to="/teacher/studentManager" />
      <van-grid-item icon="info-o" text="任务管理" to="/teacher/TaskManager" />
      <van-grid-item icon="photo-o" text="资源管理" to="/teacher/resourceManager" />
      <van-grid-item icon="send-gift-o" text="答疑管理" to="/disscuss/index" />
      <van-grid-item icon="todo-list-o" text="日报管理" />
      <van-grid-item icon="play-circle-o" text="视频管理" />
    </van-grid>
    <van-tabbar v-model="active" @change="onChange">
      <van-tabbar-item name="home" icon="home-o">主页</van-tabbar-item>
      <van-tabbar-item name="my" icon="friends-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: 'TeacherIndex',
  data: function() {
    return {
      msg: '主页',
      active: 'home'
    }
  },
  methods: {
    onChange(index) {
      if (index === 'my') {
        this.$store.dispatch('setting/setRouter', index)
        this.$router.push({ path: '/my/index' })
      }
    }
  }
}

</script>

<style scoped>

</style>
